
function trim(val)
 {
 
	 
	return val.replace(/(^\s*)|(\s*$)/g, "");  
	
}
 

function selectAll(){
	var checkall = document.getElementById('checkall');
	var listsize = document.getElementById('listsize').value;
	for(var i=0;i<listsize;i++){
		if(checkall.checked){
			document.getElementById('checkone'+i).checked = true;
		}else{
			document.getElementById('checkone'+i).checked = false;
		}
	}
}





function subForm(){

	var zhuanti_id = document.getElementById('zhuanti_id').value;
	if(zhuanti_id == ""){
		alert("请选择专题名称!");
		document.getElementById('zhuanti_id').focus();
		return false;
	}
	var str=CKEDITOR.instances.content.getData();
		str=trim(str);
		if(str==""){
			alert("评论内容不能为空");
			CKEDITOR.instances.content.focus();
				return false;
			}
		document.addForm.submit();
}
 


function delIndexInfo(){
	var listsize = document.getElementById('listsize').value;
	var pkid_string = '';
	for(var i=0;i<listsize;i++){
		if(document.getElementById('checkone'+i).checked){
			pkid_string += document.getElementById('checkone'+i).value+'|';
		}
	}
	if(pkid_string == ''){
		alert('请至少选择一条!');
		return false;
	}
	document.getElementById('pkid').value = pkid_string;
	document.indexForm.action='/doTradeReg.do';
	if(window.confirm('确认删除吗?')){
		document.indexForm.submit();
	}
}

function deleteOneInfo(pkid)
{
 
	if(window.confirm('确认删除吗？'))
	{
	  window.location.href='/doTradeReg.do?pkid='+pkid+'&bpm_id=3916';
 	}
}





	
	function searchForm(){
	 
	document.indexForm .submit();
	
}

